package com.rzhkj.box.entity;

/**
 * Created by lixin on 2017/12/18.
 * <p>
 * *.3gpp    audio/3gpp, video/3gpp
 * .ac3    audio/ac3
 * .asf       allpication/vnd.ms-asf
 * .au           audio/basic
 * .css           text/css
 * .csv           text/csv
 * .doc    application/msword
 * .dot    application/msword
 * .dtd    application/xml-dtd
 * .dwg    image/vnd.dwg
 * .dxf      image/vnd.dxf
 * .gif            image/gif
 * .htm    text/html
 * .html    text/html
 * .jp2            image/jp2
 * .jpe       image/jpeg
 * .jpeg    image/jpeg
 * .jpg          image/jpeg
 * .js       text/javascript, application/javascript
 * .json    application/json
 * .mp2    audio/mpeg, video/mpeg
 * .mp3    audio/mpeg
 * .mp4    audio/mp4, video/mp4
 * .mpeg    video/mpeg
 * .mpg    video/mpeg
 * .mpp    application/vnd.ms-project
 * .ogg    application/ogg, audio/ogg
 * .pdf    application/pdf
 * .png    image/png
 * .pot    application/vnd.ms-powerpoint
 * .pps    application/vnd.ms-powerpoint
 * .ppt    application/vnd.ms-powerpoint
 * .rtf            application/rtf, text/rtf
 * .svf           image/vnd.svf
 * .tif         image/tiff
 * .tiff       image/tiff
 * .txt           text/plain
 * .wdb    application/vnd.ms-works
 * .wps    application/vnd.ms-works
 * .xhtml    application/xhtml+xml
 * .xlc      application/vnd.ms-excel
 * .xlm    application/vnd.ms-excel
 * .xls           application/vnd.ms-excel
 * .xlt      application/vnd.ms-excel
 * .xlw      application/vnd.ms-excel
 * .xml    text/xml, application/xml
 * .zip            aplication/zip
 * .xlsx     application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
 */
public enum MediaType {
    All("data:*/*"),
    AllImage("data:image/*"),
    PNG("data:image/png"),
    JPG("data:image/jpeg"),
    GIF("data:image/gif"),
    ICO("data:image/x-icon"),
    BMP("data:image/BMP"),
    JS("data:text/javascript"),
    CSS("data:text/css"),
    HTML("data:text/html"),
    TXT("data:text/plain"),
    VIDO("data:video/file"),
    WORD("data:application/msword"),
    PPT("data:application/vnd.ms-powerpoint"),
    EXCEL("data:application/vnd.ms-excel"),
    ZIP("data:aplication/zip"),
    XML("data:application/xml-dtd"),
    PDF("data:application/pdf"),
    JSON("data:application/json"),
    ICO_Base64("data:image/x-icon;base64"),
    PNG_Base64("data:image/png;base64"),
    JPG_Base64("data:image/jpeg;base64"),
    GIF_Base64("data:image/gif;base64"),
    BMP_Base64("data:image/BMP;base64"),
    CSS_Base64("data:text/css;base64"),
    HTML_Base64("data:text/html;base64"),;
    public String val;

    MediaType(String val) {
        this.val = val;
    }

    /**
     * 任务状态
     *
     * @param stateName
     * @return
     */
    public static MediaType getEnum(String stateName) {
        for (MediaType boxStateEnum : MediaType.values()) {
            if (boxStateEnum.name().equalsIgnoreCase(stateName)) {
                return boxStateEnum;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }

}
